package com.aiyige.page.my.customer.adapter;

import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.aiyige.R;
import com.aiyige.page.my.order.model.RefundReasonModel;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.LinkedList;

import butterknife.BindView;
import butterknife.ButterKnife;

public class RefundReasonDialogListAdapter extends BaseQuickAdapter<RefundReasonModel, BaseViewHolder> {

    public RefundReasonDialogListAdapter() {
        super(new LinkedList<RefundReasonModel>());
    }

    @Override
    protected void convert(BaseViewHolder helper, RefundReasonModel item) {
        ((MyHolder) helper).bindData(item);
    }

    @Override
    protected BaseViewHolder onCreateDefViewHolder(ViewGroup parent, int viewType) {
        BaseViewHolder baseViewHolder = new MyHolder(getItemView(R.layout.item_text, parent));
        return baseViewHolder;
    }


    public class MyHolder extends BaseViewHolder {

        @BindView(R.id.tv_text)
        TextView tvText;

        public MyHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }


        public void bindData(RefundReasonModel data) {
            tvText.setText(data.getTitle());
            tvText.setSelected(data.isSelected());
        }

    }


}
